#pragma once
#include "gm_stream_mgr.h"
enum HANDLE_TYPE
{
	UNKNOWN_HANDLE = -1,
	DIGEST_HANDLE = 0,
	CRYPT_HANDLE,
	AGREE_HANDLE,
	MAC_HANDLE,
	DEVICE_HANDLE, 
	CONTAINER_HANDLE,
	APP_HANDLE
};

class gm_handle
{
public:
	gm_handle(void);
	virtual ~gm_handle(void);

	void init_handle(HANDLE_TYPE type);

	HANDLE_TYPE get_handle_type();

	HANDLE get_handle();

	void set_param(void *param) { _param = param; }

	void * get_param() { return _param;} 

protected:
	static		HANDLE generate_handle();

private:
	HANDLE_TYPE _type;
	void *	_param;
	HANDLE   _handle;

	static	ULONG s_nextHandle;
};
